#!/bin/bash

rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
yum -y update

yum -y install xrdp tiger-vncserver autoconf automake libtool openssl-devel pam-devel libX11-devel libXfixes-devel
service xrdp restart
chkconfig xrdp on

yum -y groupinstall "Desktop"
yum -y install tigervnc-server

echo "Ative um display pra um usuario..."; read
nano  /etc/sysconfig/vncservers

echo "Usuario para acesso: "; read USER
su $USER -c "vncpasswd"

chkconfig vncserver on
service vncserver start
